package ernest.uicompare.demo

import android.os.Bundle
import android.view.Window
import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity
import ernest.uicompare.ConfigBuilder
import ernest.uicompare.UICompare

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_main)
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
            UICompare.init(
                this,
                ConfigBuilder().setUIFileDir(getExternalFilesDir(null)!!.absolutePath).build()
            )
        }

    }

    override fun onResume() {
        super.onResume()
        UICompare.showFloatWindow()
        UICompare.setUI("MainActivity.jpg")
    }
}